package com.computergames.server.message.chessMessage;

import com.computergames.server.message.AbstractGameMessage;
import lombok.Data;
import lombok.EqualsAndHashCode;

@EqualsAndHashCode(callSuper = true)
@Data
//@JsonDeserialize(using = ChessMessageDeserializer.class)
public abstract class AbstractChessMessage extends AbstractGameMessage {
    //执黑或白子，象棋可表示具体棋子
    private String chess;
    /*
    eg1: coordinates[] = [{'x': 'C', 'y': 6}]
    该坐标为五子棋或围棋等落子坐标

    eg2: coordinates[] = [{'x': 'C', 'y': 6}，{'x': 'E', 'y': 6}，{'x': 'E', 'y': 4}，{'x': 'G', 'y': 4}]
    该坐标为国际跳棋或藏族久棋进行跳吃时的坐标变化

    eg3：coordinates[] = [{'x': 'C', 'y': 6}，{'x': 'E', 'y': 6}，{'x': 'E', 'y': 4}]
    亚马逊棋：该坐标前两个为棋子移动前后坐标，第三个为放置障碍的坐标；军棋：该坐标前两个为棋子移动前后坐标，第三个为对方军旗位置，位置未知时填00

    eg4：coordinates[] = [{'x': 'C', 'y': 6}，{'x': 'C', 'y': 5}]
    该坐标为短杆首尾两端放置坐标
    */
    private String[] coordinate;

    //是否吃子 true/false/together（军棋两个棋子同归于尽）
    //private boolean isCapture;

    //骰子点数，目前仅有爱恩斯坦棋含骰子
    //private int dice;

    //被吃骰子坐标
    //private String[] capturedPiecesCoordinates;

    //回合数，默认从1开始
    //private int round;

    //半回合数，该值根据不同的棋种，大于某值即可判和，发生局势变化即需归0，如棋子个数发生变化等
    //private int halfRound;

    public AbstractChessMessage(String chess, String[] coordinate) {
        this.chess = chess;
        this.coordinate = coordinate;
        //this.halfRound = halfRound;
        //this.round = round;
    }

    protected AbstractChessMessage() {
        super();
    }
    @Override
    public String toString() {
        return "PerfectInformationGameMessage{" +
                "chess='" + chess +
                ", coordinate=" + coordinate;
    }
}
